/*
 * @Author: ljkt
 * @Version: 1.1
 * @Date: 2025-05-22 10:18:35
 * @LastEditors: ljkt
 * @LastEditTime: 2025-05-22 11:35:04
 * @Description:
 */

/* Define to prevent recursive inclusion --------------------------------------*/
#ifndef __DEV_TM1680_H__
#define __DEV_TM1680_H__
#ifdef EN_I2C_TM1680
//   ID 0xe4:
//     MA1 = 0;
//     MA0 = 0;
//   ID 0xe5:
//     MA1 = 0;
//     MA0 = 1;
//   ID 0xe6:
//     MA1 = 1;
//     MA0 = 0;
//   ID 0xe7:
//     MA1 = 1;
//     MA0 = 1;

/****命令宏定义****/
#define TM1680ID 0xe7

#define SYSDIS 0x80
#define SYSEN 0x81
#define LEDOFF 0x82
#define LEDON 0x83
#define BLINKOFF 0x88
#define BLINK2HZ 0x89
#define BLINK1HZ 0x8A
#define BLINK0_5HZ 0x8B

#define SLAVEMODE 0x90
#define RCMODE0 0x98
#define RCMODE1 0x9A
#define EXTCLK0 0x9C
#define EXTCLK1 0x9E

#define COM8NMOS 0xA0
#define COM16NMOS 0xA4
#define COM8PMOS 0xA8
#define COM16PMOS 0xAC

#define PWM01 0xB0
#define PWM02 0xB1
#define PWM03 0xB2
#define PWM04 0xB3
#define PWM05 0xB4
#define PWM06 0xB5
#define PWM07 0xB6
#define PWM08 0xB7
#define PWM09 0xB8
#define PWM10 0xB9
#define PWM11 0xBA
#define PWM12 0xBB
#define PWM13 0xBC
#define PWM14 0xBD
#define PWM15 0xBE
#define PWM16 0xBF
#define TM1680_DUTY PWM16

typedef struct
{
    unsigned char Buf[32];
} s_dev_Tm1680_t;
extern Ram s_dev_Tm1680_t gDevTm1680;
void Dev_Tm1680_Init(void);
void Dev_Tm1680_Scan(void);
#endif
#endif

